{% extends 'base.html' %}

{% block title %}{{ view.kwargs.username }}的文章{% endblock %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-md-8 offset-md-2 bg-white p-4">
            <h1>{{ view.kwargs.username }}的文章({{ page_obj.paginator.count }}): </h1>
            <hr>
            {% for post in post_list %}
            <div class="media">
                <div class="media-body">
                    <h4><a class="text-decoration-none text-weight-bold text-dark" href="{{ post.get_absolute_url }}">{{ post.title }}</a></h4>
                    <small class="text-muted">作者: <a class="text-dark"
                                                     href="{% url 'blog:user_posts' username=post.user.username %}">
                        {{ post.user.username }}</a>
                        创建于 {{ post.date_created | date:"Y-m-d H:i" }}</small>
                </div>
            </div>
            <hr>
            {% endfor %}
            <!--pagination-->
            {% include 'blog/_pagination.html' %}

        </div>
    </div>
</div>

{% endblock %}

